package com.cloudloan.utils;

import com.cloudloan.entity.User;

public class AdministratorThreadLocal {
    private static ThreadLocal<User> administratorThreadLocal = new ThreadLocal<>();

    public static void setAdministrator(User sysUser) {
        administratorThreadLocal.set(sysUser);
    }

    public static User getAdministrator() {
        return administratorThreadLocal.get();
    }

    public static void removeAdministrator() {
        administratorThreadLocal.remove();
    }

    public static String getAdministratorName(){
        return administratorThreadLocal.get().getName();
    }

}
